#include	"time.h"
#include	"audio.h"

Audio::Audio(Time & time) : _speaker(time)
{
	int err = Pa_Initialize();
	if(err != paNoError)
		Pa_GetErrorText(err);
}

Audio::~Audio()
{
	int err = Pa_Terminate();
	if( err != paNoError )
		Pa_GetErrorText(err);
}

void		Audio::start()
{
	_speaker.start();
	_speaker.play();
}

ApiAudio	*Audio::getApi()
{
	ApiAudio	*api = new ApiAudio(this);
	return api;
}
